﻿using ConfExpert.Forms.Base;
using DevExpress.XtraBars;
using DevTeam;
using System;

namespace ConfExpert.Forms.Du4
{
    public partial class Missing : XForm 
    {
        public Missing()
        {
            InitializeComponent();            
        }

        private void Missing_Load(object sender, EventArgs e)
        {
            
            gvMissing.Init("GetDu4Missing");

            gvMissing.MakeColumnInvisible("Product");
            gvMissing.Columns["ModifiedOn"].VisibleIndex = 100;
            gvMissing.SetCaptions("CustomerCode:Müşteri Kodu","Composition:Kompozisyon","MissingQty:Son Eksik Miktar","LastNote:Son Not");

            gvMissing.AddDetailGrid(gvMissingDetail,"Du4MissingId");
            gvMissingDetail.SetCaptions("MissingQty:Eksik Metraj", "InvoiceNr:Fatura No", "InvoiceDate:Fatura Tarihi", "ETD:Tahmini Teslim Tarihi", "Notes:Not");


            gvMissingDetail.MakeColumnInvisible("Du4MissingId", "Du4MissingLinesId");

            gvMissing.AddSummary();

            gvMissing.OptionsBehavior.ReadOnly = true;
            gvMissingDetail.OptionsBehavior.ReadOnly = true;

            btnGuncelle.ItemClick += new ItemClickEventHandler(btnGuncelle_Click);            
        }

        void btnGuncelle_Click(object sender, ItemClickEventArgs e)
        {
            gvMissing.RefreshDataSource("GetDu4Missing");
            gvMissingDetail.BestFitColumns();
        }

                
    }
}
